Name "coMexpert"

!define PRODUCT "coMexpert"
!define FILE "coMexpert"

OutFile "setup-coMexpert-0.10.3.exe"

InstallDir $PROGRAMFILES\coMexpert

DirText "Choose a destination folder for the installation of coMexpert"

Section ""

SetOutPath $INSTDIR

CreateDirectory $INSTDIR\doc
CreateDirectory $INSTDIR\imageformats
CreateDirectory $INSTDIR\sqldrivers

File ares.ico
File ares.png
File assistant.exe
File coMexpert.exe
File libauthldap.dll
File libauthtomcat.dll
File libfreetype-6.dll
File libgcc_s_dw2-1.dll
File libjpeg-9.dll
File liblber.dll
File libldap.dll
File libmysql.dll
File libpng15-15.dll
File libpoppler-34.dll
File libpoppler-qt4-4.dll
File zlib1.dll
File libeay32.dll
File ssleay32.dll
File libssl32.dll
File mingwm10.dll
File phonon4.dll
File QtClucene4.dll
File QtCore4.dll
File QtGui4.dll
File QtHelp4.dll
File QtNetwork4.dll
File QtScript4.dll
File QtSql4.dll
File QtTest4.dll
File QtWebkit4.dll
File QtXml4.dll
File QtXmlPatterns4.dll
File vcredist_x86.exe

SetOutPath $INSTDIR\doc
File doc\coMexpert.qch
File doc\coMexpert.qhc

SetOutPath $INSTDIR\imageformats
File imageformats\qjpeg4.dll

SetOutPath $INSTDIR\sqldrivers
File sqldrivers\qsqlmysql4.dll

CreateShortCut "$DESKTOP\${PRODUCT}.lnk" "$INSTDIR\${FILE}.exe" ""
CreateDirectory "$SMPROGRAMS\${PRODUCT}"
CreateShortCut "$SMPROGRAMS\${PRODUCT}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\${PRODUCT}\${PRODUCT}.lnk" "$INSTDIR\${FILE}.exe" "" "$INSTDIR\${FILE}.exe" 0

WriteUninstaller $INSTDIR\uninstall.exe

ExecWait '"$INSTDIR\vcredist_x86.exe /q:a"'

SectionEnd

Section "Uninstall"

Delete $INSTDIR\ares.ico
Delete $INSTDIR\ares.png
Delete $INSTDIR\assistant.exe
Delete $INSTDIR\coMexpert.exe
Delete $INSTDIR\libauthldap.dll
Delete $INSTDIR\libauthtomcat.dll
Delete $INSTDIR\libfreetype-6.dll
Delete $INSTDIR\libgcc_s_dw2-1.dll
Delete $INSTDIR\libjpeg-9.dll
Delete $INSTDIR\liblber.dll
Delete $INSTDIR\libldap.dll
Delete $INSTDIR\libmysql.dll
Delete $INSTDIR\libpng15-15.dll
Delete $INSTDIR\libpoppler-34.dll
Delete $INSTDIR\libpoppler-qt4-4.dll
Delete $INSTDIR\zlib1.dll
Delete $INSTDIR\libeay32.dll
Delete $INSTDIR\ssleay32.dll
Delete $INSTDIR\libssl32.dll
Delete $INSTDIR\mingwm10.dll
Delete $INSTDIR\phonon4.dll
Delete $INSTDIR\QtClucene4.dll
Delete $INSTDIR\QtCore4.dll
Delete $INSTDIR\QtGui4.dll
Delete $INSTDIR\QtHelp4.dll
Delete $INSTDIR\QtNetwork4.dll
Delete $INSTDIR\QtScript4.dll
Delete $INSTDIR\QtSql4.dll
Delete $INSTDIR\QtTest4.dll
Delete $INSTDIR\QtWebkit4.dll
Delete $INSTDIR\QtXml4.dll
Delete $INSTDIR\QtXmlPatterns4.dll
Delete $INSTDIR\vcredist_x86.exe
Delete $INSTDIR\doc\coMexpert.qch
Delete $INSTDIR\doc\coMexpert.qhc
Delete $INSTDIR\imageformats\qjpeg4.dll
Delete $INSTDIR\sqldrivers\qsqlmysql4.dll
Delete $INSTDIR\uninstall.exe

RMDir $INSTDIR\doc
RMDir $INSTDIR\imageformats
RMDir $INSTDIR\sqldrivers
RMDir $INSTDIR

Delete "$DESKTOP\${PRODUCT}.lnk"
Delete "$SMPROGRAMS\${PRODUCT}\*.*"
RmDir  "$SMPROGRAMS\${PRODUCT}"

SectionEnd
